package com.pureut.system.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pureut.common.security.utils.SecurityUtils;
import com.pureut.system.domain.ReviewInformation;
import com.pureut.system.domain.vo.ReviewInformationVo;
import com.pureut.system.mapper.ReviewInformationMapper;
import com.pureut.system.service.IReviewInformationService;
import org.apache.catalina.security.SecurityUtil;
import org.springframework.stereotype.Service;
import java.util.Date;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;

/**
 * @Author: pureut
 * @Date: 2025-04-08 16:06:15
 * @Desc: 评审信息表
 */
@Service("reviewInformationService")
public class ReviewInformationServiceImpl extends ServiceImpl<ReviewInformationMapper, ReviewInformation> implements IReviewInformationService {

    /**
     * 评审信息表Dao
     */
    @Resource
    private ReviewInformationMapper reviewInformationMapper;




    /**
     * 新增评审信息表
     * @param reviewInformationVo
     * @return
     */
    @Override
    public Boolean save(ReviewInformationVo reviewInformationVo) {
        ReviewInformation reviewInformation = new ReviewInformation();
        BeanUtil.copyProperties(reviewInformationVo, reviewInformation);
        reviewInformation.setCreateBy(SecurityUtils.getUsername());
        reviewInformation.setCreateTime(new Date());
        return save(reviewInformation);
    }


    /**
     * 更新评审信息表
     * @param reviewInformationVo
     * @return
     */
    @Override
    public Boolean updateById(ReviewInformationVo reviewInformationVo) {
        ReviewInformation reviewInformation = new ReviewInformation();
        BeanUtil.copyProperties(reviewInformationVo, reviewInformation);
        reviewInformation.setUpdateBy(SecurityUtils.getUsername());
        reviewInformation.setUpdateTime(new Date());
        return updateById(reviewInformation);
    }
}
